package com.shop.cloud.upms.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.shop.cloud.common.core.sensitive.Sensitive;
import com.shop.cloud.common.core.sensitive.SensitiveTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.Data;
import lombok.EqualsAndHashCode;

import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * <p>
 * 租户机构管理
 * </p>
 *
 * @author
 */
@Data
@Schema(description = "租户管理")
@EqualsAndHashCode(callSuper = true)
@TableName(value="sys_tenant")
public class SysTenant extends Model<SysTenant> {

	private static final long serialVersionUID = 1L;

	@Schema(description = "PK")
	@TableId(type = IdType.INPUT)
	private String id;
	/**
	 * 租户名称
	 */
	@Schema(description = "租户名称")
	@NotNull(message = "租户名称不能为空")
	private String name;
	/**
	 * 排序
	 */
	@Schema(description = "排序")
	@NotNull(message = "排序不能为空")
	private Integer sort;
	/**
	 * 租户编码
	 */
	@Schema(description = "租户编码")
	@NotNull(message = "租户编码不能为空")
	private String code;
	/**
	 * 类型：1租户；-1平台系统管理
	 */
	@Schema(description = "类型：1租户；-1平台系统管理")
	private String type;
	/**
	 * 电话
	 */
	@Sensitive(type = SensitiveTypeEnum.MOBILE_PHONE)
	@Schema(description = "电话")
	private String phone;
	/**
	 * 传真
	 */
	@Schema(description = "传真")
	private String fax;
	/**
	 * 邮箱
	 */
	@Schema(description = "邮箱")
	private String email;
	/**
	 * 地址
	 */
	@Schema(description = "地址")
	private String address;
	/**
	 * 备注
	 */
	@Schema(description = "备注")
	private String remarks;
	/**
	 * 创建时间
	 */
	@Schema(description = "创建时间")
	private LocalDateTime createTime;
	/**
	 * 修改时间
	 */
	@Schema(description = "修改时间")
	private LocalDateTime updateTime;

	/**
	 * 状态 0:正常，9:冻结
	 */
	@Schema(description = "状态 0:正常，9:冻结")
	private String status;

	/**
	 * 是否删除  -1：已删除  0：正常
	 */
//	@TableLogic
	@Schema(description = "是否删除")
	private String delFlag;

	/**
	 * logo
	 */
	@Schema(description = "logo")
	private String logo;
	/**
	 * 官方网址
	 */
	@Schema(description = "官方网址")
	private String homeUrl;
	/**
	 * 到期时间
	 */
	@Schema(description = "到期时间")
	private LocalDateTime expireTime;
	/**
	 * 租户套餐ID
	 */
	@Schema(description = "租户套餐ID")
	private String packageId;
	/**
	 * 公司名
	 */
	@Schema(description = "公司名")
	private String companyName;
	/**
	 * 公司信用代码
	 */
	@Schema(description = "公司信用代码")
	private String companyCode;
	/**
	 * 公司营业执照
	 */
	@Schema(description = "公司营业执照")
	private String companyLicense;

	@TableField(exist = false)
	private String username;

	@TableField(exist = false)
	private String password;

	@TableField(exist = false)
	private String userPhone;
}
